//
//  ImageCollectionViewCell.m
//  CivilianTravel
//
//  Created by 许仕杰 on 16/7/18.
//  Copyright © 2016年 许仕杰. All rights reserved.
//

#import "ImageCollectionViewCell.h"
#import "CircleCollectionViewLayoutAttributes.h"

@interface ImageCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation ImageCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setImageName:(NSString *)imageName {
    _imageName = imageName;
//    self.imageView.image = [UIImage imageNamed:_imageName];
    [_imageView sd_setImageWithURL:[NSURL URLWithString:imageName] ];
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    CircleCollectionViewLayoutAttributes *circleCollectionViewLayoutAttributes = (CircleCollectionViewLayoutAttributes *)layoutAttributes;
    self.layer.anchorPoint = circleCollectionViewLayoutAttributes.anchorPoint;
    CGPoint center = self.center;
    center.y += (circleCollectionViewLayoutAttributes.anchorPoint.y - 0.5) * CGRectGetHeight(self.bounds);
    self.center = center;
}


@end
